package com.monolithiot.sso.dao.mapper;

import com.monolithiot.sso.common.entity.DeviceAuthorization;
import com.monolithiot.sso.dao.BaseMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 2018/12/22 Create by 郭文梁
 * DeviceAuthorizationMapper
 * 设备授权数据访问组件
 *
 * @author 郭文梁
 * @date 2018/12/22
 */
@Repository
public interface DeviceAuthorizationMapper extends BaseMapper<DeviceAuthorization> {
    /**
     * 根据条件查询授权，同时抓取关联属性
     *
     * @param query 条件
     * @return DeviceAuthorization entity (with User entity) List
     */
    List<DeviceAuthorization> selectFetchAll(DeviceAuthorization query);

    /**
     * 删除过期额授权
     *
     * @return 删除的数据数量
     */
    int deleteOverdue();
}
